package com.example.vue20220402.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.vue20220402.model.Order;
import com.example.vue20220402.model.SecDoc;
import com.example.vue20220402.model.TimeQuan;
import com.example.vue20220402.pojo.Usersinfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface OrderMapper extends BaseMapper<Order> {

    IPage<Order> selectOrderPage(IPage<Order> page, @Param(Constants.WRAPPER) Wrapper<Order> wrapper);

    @Select(" select * from timequantum where timequantum_id not in (" +
            " select t.timequantum_id from `order` o left join timequantum t on o.timequantum_id = t.timequantum_id" +
            " where o.order_date = #{orderDate} and o.order_status = #{orderStatus}" +
            " and o.doctor_id = #{doctorId} )")
    List<TimeQuan> orderMapper(Order order);

//    @Select("select e.*,d.doctor_id,d.doctor_name from section e left join doctor d on e.section_id = d.section_id")
//    List<SecDoc> selectSecDocs();

}
